//ConstantProduct.java
package builder.simplified.mixAll;

/**
 *@author:youtubezou
 *@version:2012-7-15
 */
public class ConstantProduct {
	private String name;
	private double price;
	private int size;
	private double totalPrice;
	
	/*contain product construct logical*/
	public void construct(String name, double price, int size){
		setName(name);
		setPrice(price);
		setSize(size);
		countTotalPrice();
	}
	
	private void countTotalPrice() {
		totalPrice = price * size;
	}

	/*create product components*/
	private void setName(String name) {
		this.name = name;
	}
	private void setPrice(double price) {
		this.price = price;
	}
	private void setSize(int size) {
		this.size = size;
	}
	
	public String toString(){
		return "ProductA:" + "\n\t" + 
		"name:" + "\t" + name + "\n\t" +
		"price:" + "\t" + price + "\n\t" +
		"size:" + "\t" + size + "\n\t" +
		"totalPrice" + "\t" + totalPrice;
	}
}
